<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册-倍倍利</title>
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/base.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/loginregister.css') }}">
    <link rel="icon" href="{{asset('resources/web/images/logo-icon.png')}}" type="image/x-icon"/>
</head>
<body>
<!--register header-->
<div class="reglogin-header wrap clearfix">
    <div class="logo"><a href="{{ $logo->link }}"><img src="{{ asset($logo->image) }}" alt="倍倍利" style="height: 40px;width: 120px;"></a></div>
    <div class="page-title">注册</div>
    <div class="reglogin-header-right R">
        <ul class="top-nav clearfix">
            <li><a href="/">首页</a></li>
            <li><a href="#"><i class="ico-mb"></i>手机客户端</a></li>
        </ul>
        <div class="top-tel">服务热线：400-960-2388</div>
    </div>
</div>
<!--register header /-->
<!--container-->
<div class="reglogin-container wrap clearfix">
    <div class="leftbanner" style="background-image:url({{ asset($ad->image) }});">
        <a href="{{ $ad->link }}" title="{{ $ad->name }}" ></a>
    </div>
    <div class="right-form">
        <div class="right-form-title">
            <span class="R">已有账号？<a href="{{ action('Auth\AuthController@login') }}">立即登录</a></span>
            <h3>新用户注册</h3>
        </div>
        <form method="post" action="{{ action('Auth\AuthController@create') }}" class="form-validation">
            {{ csrf_field() }}
            @foreach ($errors->all() as $error)
                <div class="error_messages error-tips" style="display: block;color:orangered;">{{ $error }}</div>
                @endforeach
                        <!--表单 验证判断  错误：error，   正确：correct -->
                <div class="form-item">
                    <label>
                        <i class="ico-user"></i>
                        <input id="username" type="text" name="username" class="txt" placeholder="请输入用户名"
                               data-rule-required="true"
                               data-msg-required="请输入用户名"
                               data-rule-remote="{{ action('Utils\UtilsController@userNameExists') }}"
                               data-msg-remote="此用户名已经存在" data-rule-pattern="[a-zA-Z]\w{5,17}"
                               data-msg-pattern="有效格式位 字母 数字 或下划线 长度为 6-18位">
                    </label>
                </div>
                <div class="form-item">
                    <label>
                        <i class="ico-lock"></i>
                        <input type="password" name="password" class="txt" placeholder="请输入登录密码"
                               data-rule-required="true"
                               data-msg-required="请输入登陆密码" data-rule-minlength="6">
                    </label>
                </div>
                <div class="form-item">
                    <label class="form-msg"><input name="captcha" type="text" class="stxt" placeholder="请输入图片验证码"
                                                   data-rule-required="true" data-msg-required="请输入图片验证码"
                                                   data-rule-remote="{{  action('Utils\UtilsController@captcha_check') }}"
                                                   data-msg-remote="验证码不正确"></label>
                    <img class="reg-captcha" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码"
                         src="{{  action('Utils\UtilsController@captcha') }}"
                         height="36" width="140">
                    <div class="error-tips">验证失败，请重新获取验证</div>
                </div>
                <div class="reg-referee-code">
                    <p><i></i> 推荐人编码(选填)</p>
                    <input type="text" class="txt" name="recommended" placeholder="推荐人编码(选填)" value="{{ $code or '' }}" {{ (isset($code)&&!empty($code))?'readonly=readonly':'' }}>
                </div>
                <div class="user-pact">
                    <label>
                        <input type="checkbox" id="J_user_pact">
                        <span>已阅读并同意</span>
                    </label>
                    <a href="{{ action('Auth\AuthController@registerAgreement') }}" target="_blank">《倍倍利金融服务有限公司网站服务协议》</a>
                </div>
                <div class="user-pact-tips">请先阅读，并同意服务协议</div>
                <button type="submit" class="right-form-submit">立即注册</button>
        </form>
    </div>
</div>
<!--container /-->
<!--indemnification-->
<div class="indem-wrap">
    <div class="special-service wrap clearfix">
        <h2 class="text-center">注册倍倍利 安全保障好收益</h2>
        <dl>
            <dt><img src="{{ asset('resources/web/images/special_s1.png') }}" height="60" width="60"></dt>
            <dd>
                <em>多元化投资</em>
                <span>多元化的产品结构设计</span>
            </dd>
        </dl>
        <dl>
            <dt><img src="{{ asset('resources/web/images/special_s2.png') }}" height="60" width="60"></dt>
            <dd>
                <em>严密风控</em>
                <span>严格的风控流程管理</span>
            </dd>
        </dl>
        <dl>
            <dt><img src="{{ asset('resources/web/images/special_s3.png') }}" height="60" width="60"></dt>
            <dd>
                <em>资金安全</em>
                <span>交易资金由第三方托管</span>
            </dd>
        </dl>
        <dl>
            <dt><img src="{{ asset('resources/web/images/special_s4.png') }}" height="60" width="60"></dt>
            <dd>
                <em>第三方担保</em>
                <span>降低P2P借贷风险</span>
            </dd>
        </dl>
        <dl>
            <dt><img src="{{ asset('resources/web/images/special_s5.png') }}" height="60" width="60"></dt>
            <dd>
                <em>风险备用金</em>
                <span>贴心的备付金体系</span>
            </dd>
        </dl>
    </div>
</div>
<!--indemnification /-->
<!--footer-->
<div class="reglogin-footer">
    <div class="copyright wrap">
        <p>Copyright © 2014倍倍利 版权所有 | 重庆倍倍利金服科技有限公司 | ICP备案号：渝ICP备14050900号-2</p>
    </div>
</div>
<!--footer /-->
<script type="text/javascript" src="{{ asset('resources/web/js/jquery.min.js') }}"></script>
<script type="text/javascript"
        src="{{ asset('resources/web/plugins/jquery.validate/jquery.validate.min.js') }}"></script>
<script type="text/javascript"
        src="{{ asset('resources/web/plugins/jquery.validate/additional-methods.min.js') }}"></script>
<script src="{{ asset('resources/web/plugins/jquery.validate/localization/messages_zh.js') }}"></script>
{{--<script src="{{ asset('resources/web/js/reglogin.js') }}"></script>--}}
<script type="text/javascript">
    function newgdcode(obj, url) {
        obj.src = url + '?nowtime=' + new Date().getTime();
    }
    $(function () {
        $('form.form-validation').validate({
            errorElement: 'div',
            errorPlacement: function (error, element) {
                error.addClass('help-block error-tips').appendTo(element.parent().parent());
            },
            success: function (label, element) {
                label.remove();
            }
        });
    });

    $('.reg-referee-code p').on('click', function () {
        $(this).parent().toggleClass('active');
    });
    // 勾选同意协议
    $('#J_user_pact').on('click', function () {
        if ($(this).prop('checked')) {
            $('.user-pact-tips').hide();
        }
    });

    // 表单提交
    $('.right-form-submit').on('click', function () {
        // 判断用户协议是否勾选
        if ($('#J_user_pact')[0] && !$('#J_user_pact').prop('checked')) {
            $('.user-pact-tips').show();
            return false;
        }

        return true;
    });
    $('input').focus(function () {
        $('.error_messages').remove();
    });
</script>
@include('web.partials.baidu')
</body>
</html>